package com.cf.base.sp.engine.impl;

import com.alibaba.fastjson.JSON;
import com.cf.base.sp.engine.JsonEngine;

import java.lang.reflect.Type;

/**
 * @author yangji
 */
public class FastJsonEngineImpl implements JsonEngine {

    @Override
    public <T> T fromJson(String content, Type type) {
        return JSON.parseObject(content, type);
    }

    @Override
    public String toJsonString(Object body) {
        return JSON.toJSONString(body);
    }
}
